package com.tang.algorithm.listnode;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tlm
 * @Description
 */
public class LeetCoode1290 {
    public int getDecimalValue(ListNode head) {
        int res = 0;
        while (head != null) {
            int a = head.val;
            res=res*2+a;
            head = head.next;
        }
        return res;
    }
}
